package xjf;

import java.util.Scanner;

public class NumBoom {
    public static void main(String[] args) {
        System.out.println("输入0-100之间的数字");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int max = 100;
        int min = 0;
        int b = (int)(Math.random() * 98.0D + 1.0D);

        while(true) {
            while(a != 9999) {
                if (a > min && a < max) {
                    if (a > b) {
                        System.out.println("输入" + min + "到" + a + "之间的数字");
                        max = a;
                        a = sc.nextInt();
                        if (a >= max) {
                            max = max;
                            System.out.println("瞎鸡巴喊重来,喊小点");
                            System.out.println("输入" + min + "到" + max + "之间的数字");
                            a = sc.nextInt();
                        }
                    } else if (a < b) {
                        System.out.println("输入" + a + "到" + max + "之间的数字");
                        min = a;
                        a = sc.nextInt();
                        if (a <= min) {
                            min = min;
                            System.out.println("瞎鸡巴喊重来,喊大点");
                            System.out.println("输入" + min + "到" + max + "之间的数字");
                            a = sc.nextInt();
                        }
                    }

                    if (a == b) {
                        System.out.println("BOOM!");
                        max = 100;
                        min = 0;
                        System.out.println("重新开始请在0-100之间输入一个你想要的数字");
                        b = (int)(Math.random() * 98.0D + 1.0D);
                        a = sc.nextInt();
                    }
                } else {
                    System.out.println("瞎鸡巴喊重来,有这个范围不嘛");
                    min = min;
                    max = max;
                    System.out.println("输入" + min + "到" + max + "之间的数字");
                    a = sc.nextInt();
                }
            }

            System.out.println("欢迎下次光临");
            return;
        }
    }
}
